/**
 * An abstract class, describing the ``Agent''.
 */
public abstract class Agent
{
	/**
	 * C-style enum to be able to add or find ticket ammounts
	 */
	public static final int TAXI = 0;
	public static final int BUS = 1;
	public static final int UNDERGROUND = 2;
	public static final int BLACK = 3;
	public static final int TWO_TIMES = 4;

	public int[] tickets = new int[5];

	protected Node position;

	protected Map map;

	protected boolean visible;

	/**
	 * The constructor
	 */
	public Agent(Node positionIn, Map theMap)
	{
		position = positionIn;
		map = theMap;
		setDefaultVisibility();
	}

	/**
	 * Get the amount of cards available for one type.
	 */
	public int getNumberOfTickets(int type)
	{
		return tickets[type];
	}

	public Node getPosition()
	{
		return position;
	}

	public void moveToPosition(Movement move)
	{

		position = move.getNode();
        int type = move.getType();
		tickets[type]--;
	}

	public void move() throws Exception
	{
		throw new Exception("Normal agents can not move on their own");
	}

	public boolean isVisible()
	{
		return visible;
	}

	public void makeVisible()
	{
		visible = true;
	}

	public void makeInvisible()
	{
		visible = false;
	}

	abstract public void setDefaultVisibility();
}
